import request from "@/utils/request.js";
import Cache from "@/utils/cache.js"
const url = '/salesman'
/**
 *  下单
 */
export function confirmOrder(data) {
	return request.post(url + `/order/confirmOrder`, data);
}


/**
 *  下单（无规格）
 */
export function confirmOrderNoSku(data) {
	return request.post(url + `/order/confirmOrderNoSku`, data);
}


/**
 *  查询订单详情
 */
export function getByOrderNumSalesman(orderNum) {
	return request.get(url + `/order/getByOrderNumSalesman/${orderNum}`,);
}

/**
 *  业务员小程序-orderNum获取订单、券码详情
 */
export function getOrderDetailSalesmanByOrderNum(orderNum) {
	return request.get(url + `/order/getOrderDetailSalesmanByOrderNum/${orderNum}`,);
}
/**
 *  
 */

/**
 * 订单列表 
 */
export function getListBySalesman(data) {
	return request.post(url + `/order/getListBySalesman`, data)
}

/**
 * 退款订单列表 
 */
export function getRefundListBySalesman(data) {
	return request.post(url + `/order/getRefundListBySalesman`, data)
}

/**
 * 订单退款
 */
export function refundOrder(data) {
	// return request.post(url +`/order/refundOrder`, data) //1.0.2
	return request.post(url + `/order/refundOrderNew`, data)
}

/**
 * 取消订单
 */
export function cancelOrder(data) {
	return request.post(url + `/order/cancelOrder`, data)
}


/**
 * 获取订单支付信息(在订单列表中针对只下单未付款的订单调用)
 */
export function getOrderPay(orderNum) {
	return request.post(url + `/order/getOrderPay/${orderNum}`)
}

/**
 * 获取领取记录
 */
export function getOrderReceiveList(data) {
	return request.post(url + `/order/getOrderReceiveList`, data)
}
/**
 *根据订单号查询订单的已领取券码数量
#1
 */
export function countReceive(orderNum) {
	return request.get(url + `/receiveSalesman/countReceive/${orderNum}
`,)
}
/**
 * 获取二维码
 */
export function getMiniCodeByAppId(data) {
	return request.post(url + `/wechat/getMiniCodeByAppId`, data)
}

/**
 * 业务端小程序-小鸡获取支付参数 V-1.0.5
 */
export function salesmanChickenPay(data) {
	return request.post(url + `/placeChickenAnOrder`, data)
}

/**
 * 业务员小程序-设置订单的限制领取次数
 */
export function updateRestrictClaim(data) {
	return request.post(url + `/order/updateRestrictClaim`, data)
}
/**
 * 业务员小程序-设置订单的限制领取方式
 */
export function updateRestrictClaimType(data) {
	return request.post(url + `/order/updateRestrictClaimType`, data)
}

/**
 * 业务员小程序-切换订单礼品发放模式
#10552
 */
export function updateGiftDistributionType(data) {
	return request.post(url + `/order/updateGiftDistributionType`, data)
}

/**
 * 生成微信公众号二维码
 */
export function genWxMpQrCode(data) {
	return request.post(url + `/wx/qrcode/genWxMpQrCode`, data)
}